<script language="javascript1.4" type="text/javascript">
	var nToggled;	
	var oSelfToggled;	
	{literal}
	function tree_toggle (nID,oSelf){		
		oLayer=document.getElementById('div_'+nID);
		if(oLayer.childNodes.length==0) return false;
		if(oLayer.style.visibility=='visible'){
			oLayer.style.visibility='hidden';
			oLayer.style.position='absolute';
			oSelf.innerHTML='( + )';
		} else {
			oLayer.style.visibility='visible';
			oLayer.style.position='relative';
			oSelf.innerHTML='( -- )';
		}
		if(typeof(nToggled)!='undefined' && nToggled!=nID){
			oLayer2=document.getElementById('div_'+nToggled)
			oLayer2.style.visibility='hidden';
			oLayer2.style.position='absolute'
			oSelfToggled.innerHTML='( + )';
		}
		nToggled=nID;		
		oSelfToggled=oSelf;
	}
	{/literal}
</script>
{strip}
{counter start=0 skip=1 assign="ct"}
	{foreach from=$tree item=el}
	{counter assign="ct"}	
	{if $el.depth==0 && $ct>1}</div>{/if}
	{assign var='depth' value=$el.depth}
	<div style="border-bottom:1px solid #dbe1e5; {if $data.path.$depth.id==$el.id} background-color:#edf0f2; font-weight:bold;{/if}; padding:1px 3px 2px {math equation="x*y+z" x=$el.depth y=25 z=2}px;  ">{if $el.depth==0}<a href="#" onClick="tree_toggle({$el.id},this); return false;" id="link_{$el.id}" style="font-weight:normal ">( + )</a>{/if} <a href=index.php?admin=1&id={$el.id} target="_parent">{$el.name|addslashes}</a></div>
	{if $el.depth==0}<div id="div_{$el.id}" style="visibility:hidden; position:absolute; width:100%;">{/if}	
	{/foreach}
	</div>
	{*if $smarty.get.selected*}
		<script language="javascript1.4" type="text/javascript">
		tree_toggle ({$data.path[0].id},document.getElementById('link_{$data.path[0].id}'));
		</script>
	{*/if*}
{/strip}